//
//  LPTPatientsPicTableViewCell.m
//  LPTClient
//
//  Created by mac on 2018/12/8.
//  Copyright © 2018年 zhaodd. All rights reserved.
//

#import "LPTPatientsPicTableViewCell.h"

@implementation LPTPatientsPicTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

-(void)refreshWithArray:(NSArray <NSDictionary *>*)array
{
    [self.contentView removeAllSubviews];
    
    for (int i = 0; i < array.count; i ++) {
        
        NSDictionary *dic = array[i];
        
        UIImageView *image = [[UIImageView alloc] init];
        image.contentMode = UIViewContentModeScaleAspectFit;
        [self.contentView addSubview:image];
        
        [image mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.size.mas_equalTo(CGSizeMake(kScreenWidth/3, 140));
            make.leading.mas_equalTo(i * (kScreenWidth/3));
            make.top.mas_equalTo(self.contentView);
        }];
        
        [image setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@/%@",BASE_URL,dic[@"url"]]] placeholder:nil];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
